//package com.gugee.tiktok.data.consumer.blogger.config;
//
//import com.gugee.tiktok.data.common.config.KafkaConsumerCommon;
//import com.gugee.tiktok.data.common.msg.BloggerMessage;
//import com.gugee.tiktok.data.common.msg.HashtagMessage;
//import org.apache.kafka.clients.consumer.ConsumerConfig;
//import org.apache.kafka.common.serialization.LongDeserializer;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.kafka.annotation.EnableKafka;
//import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
//import org.springframework.kafka.config.KafkaListenerContainerFactory;
//import org.springframework.kafka.core.ConsumerFactory;
//import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
//import org.springframework.kafka.listener.ConcurrentMessageListenerContainer;
//import org.springframework.kafka.listener.ContainerProperties;
//
//import java.util.HashMap;
//import java.util.Map;
//
///**
// *
// * @author luolifeng
// * Date  2020/10/04
// */
//@Configuration
//@EnableKafka
//public class KafkaConsumerHashtagConfig {
//    @Autowired
//    KafkaConsumerCommon kafkaConsumerCommon;
//    @Value("${kafka.consumer.concurrency}")
//    private int concurrency;
//    @Bean("factoryHashtagAck")
//    public KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, String>>
//    kafkaListenerContainerFactoryAck() {
//        ConcurrentKafkaListenerContainerFactory<String, String> factory
//                = new ConcurrentKafkaListenerContainerFactory<>();
//        factory.setConsumerFactory(kafkaConsumerCommon.consumerFactoryAck(HashtagMessage.MsgDeserializer.class));
//        factory.setConcurrency(concurrency);
//        factory.getContainerProperties().setPollTimeout(1500);
//        //设置为批量消费，每个批次数量在Kafka配置参数中设置
//        factory.setBatchListener(true);
//        factory.getContainerProperties().setAckMode(ContainerProperties.AckMode.MANUAL_IMMEDIATE);
//        return factory;
//    }
//
//}
